package com.mall.group_booking.feign;

import com.mall.common.response.CommonResponse;
import com.mall.entity.bargain.BgOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author White
 * @version 1.0
 * @email 616769721@qq.com
 * @date 2021/7/22 17:15
 */
@FeignClient("order")
@RequestMapping(value = "/Order")
public interface OrderFeign {

    /**
     * 根据订单id查询订单记录
     * @PathVariable id 订单id
     * @return BgOrder
     */
    @GetMapping("/findOne")
    BgOrder findOne(
            @RequestParam("id") Long id
    );

    /**
     * 传入订单id修改状态
     * @param id 订单id
     * @param status 状态
     * @return 返回
     */
    @PutMapping("/updateOrderStatus/{id}/{status}")
    CommonResponse updateOrderStatus(
            @PathVariable("id") Long id,
            @PathVariable("status") String status
    );

    @PostMapping("/createOrder")
    BgOrder createOrder(@RequestBody BgOrder bgOrder);

}
